import {Key} from 'react'
import { request } from "@/utils/http";
import {IHospitalSetPrams,IHospitalSetsLsResponse,IHospitalSetAddOrUpdate} from './model/hospitalSetsType'

export const reqHospitalSet = ({page,limit,hosname,hoscode}:IHospitalSetPrams)=>{
    return request.get<any,IHospitalSetsLsResponse>(`/admin/hosp/hospitalSet/${page}/${limit}`,{
        params:{
            hosname,
            hoscode
        }
    })
}

// 添加
export const reqHospitalSetAdd = (data:IHospitalSetAddOrUpdate)=>{
    return request.post<any,null>(`/admin/hosp/hospitalSet/save`,data)
}
// 获取单条
export const reqOneHospitalSet = (id:string)=>{
    return request.get<any,IHospitalSetsLsResponse>(`/admin/hosp/hospitalSet/get/${id}`)
}
// 更新、编辑
export const reqHospitalSetUpdate = (data:IHospitalSetAddOrUpdate)=>{
    return request.put<any,null>(`/admin/hosp/hospitalSet/update`,data)
}
// 删除
export const reqHospitalSetDelete = (id:number)=>{
    return request.delete<any,null>(`/admin/hosp/hospitalSet/remove/${id}`)
}

// 批量删除
export const reqHospitalSetDeletes = (isList:Key[])=>{
    return request.delete<any,null>(`/admin/hosp/hospitalSet/batchRemove`,{
        data:isList
    })
}
